The invention relates to computing systems, and more particularly to a method and mechanism for dynamically configuring a state machine. A finite state machine can be considered a model of computation consisting of a set of states, a start state, definitional alphabet/symbols, and transition functions which map input symbols and current states to a next state. Computation begins in the start state, and changes to new states depending on the transition function. The logic/computation flows of many computer software/hardware mechanisms are implemented as finite state machines.
In a distributed or networked environment, multiple state machines may need to interact to perform work on behalf of the computing system. This occurs, for example, if a first software application performing work on a local computer node communicates and interacts with second software application performing work on a remote computer node. In this situation, it is likely that the computation of the state machine associated with the first software application will be affected by the computation of the state machine associated with the second software application, and vice versa.
When two state machines interact, problems may arise if a conflict exists between states at the two state machines. For example, assume that a first state machine is in a “send” state to send information to a second state machine. In a half-duplex environment, the first state machine is expecting the second state machine to be in a “receive” state, ready and able to receive the transmitted information. If the second state machine is in a conflicting state, then a half-duplex communications fault may occur. This type of conflicting state may exist, for example, if the second state machine was itself in a “send” state trying to simultaneously transmit information to the first state machine.
The present invention provides a method and mechanism to dynamically change the logical path of a state machine to avoid such conflicts. According to one embodiment of the invention, a “toggle” state is employed for a state machine that allows dynamic changes in the computation path of a state machine. By analyzing the expected response state of a remote state machine, toggle states can be inserted in the path of a local state machine to avoid conflicts. In one embodiment, this approach can be advantageously employed to reduce or prevent half-duplex violations for communications between applications on multiple computing nodes. Further details of aspects, objects, and advantages of the invention are described below in the detailed description, drawings, and claims.